package com.ytjj.qmyx.supplychain.common.api;

import com.github.pagehelper.PageInfo;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 分页数据封装类
 *
 * 
 */
public class CommonPageExtend<T> {
    private Integer pageNum;
    private Integer pageSize;
    private Integer totalPage;
    private Long total = 1L;
    private List<T> list;

    /**
     * 将PageHelper分页后的list转为分页信息
     */
    public static <T> CommonPageExtend<T> restPage(List<T> list) {
        CommonPageExtend<T> result = new CommonPageExtend<T>();
        PageInfo<T> pageInfo = new PageInfo<T>(list);
        result.setTotalPage(pageInfo.getPages());
        result.setPageNum(pageInfo.getPageNum());
        result.setPageSize(pageInfo.getPageSize());
        result.setTotal(pageInfo.getTotal());
        result.setList(pageInfo.getList());
        return result;
    }

    /**
     * 将SpringData分页后的list转为分页信息
     */
    public static <T> CommonPageExtend<T> restPage(Page<T> pageInfo) {
        CommonPageExtend<T> result = new CommonPageExtend<T>();
        result.setTotalPage(pageInfo.getTotalPages());
        result.setPageNum(pageInfo.getNumber());
        result.setPageSize(pageInfo.getSize());
        result.setTotal(pageInfo.getTotalElements());
        result.setList(pageInfo.getContent());
        return result;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }


    /**
     * uv
     */
    private Integer uvCount;

    /**
     * 新用户数
     */
    private Integer newUserCount;

    /**
     * 已激活用户数
     */
    private Integer activationUserCount;

    /**
     * 新用户订单
     */
    private Integer newUserOrderCount;

    /**
     * 意向订单
     */
    private Integer intentionOrderCount;

    /**
     * 带地址订单
     */
    private Integer orderCountCount;

    /**
     * 支付订单数
     */
    private Integer payCountCount;

    /**
     * 订单率
     */
    private Double orderRateCount;

    /**
     * 支付率
     */
    private Double payRateCount;

    /**
     * 订单金额
     */
    private Double paymentCount;

    /**
     * 成本
     */
    private Double costCount;

    /**
     * 利润
     */
    private Double profitCount;

    private Integer pvCount;

    /**
     * 商品id
     */
    private Integer productIdCount;

    /**
     *
     */
    private Double costPriceCount;

    /**
     * 未支付订单数：带地址订单数-支付订单数
     */
    private Integer unpayCountCount;

    private Integer flagCount;

    private Double priceCount;

    /**
     * 激活量
     */
    private Integer activationCount;

    /**
     * 注册量
     */
    private Integer registerCount;

    /**
     * 注册转化率
     */
    private Double regRateCount;

    /**
     * 每日启动数
     */
    private Integer enablementCount;

    /**
     * 注册活跃用户占比
     */
    private Double regActRateCount;

    /**
     * 活跃用户数
     */
    private Integer activeCount;

    /**
     * pv订单率
     */
    private Double orderPvCountCount;

    /**
     * uv订单率
     */
    private Double orderUvCountCount;

    /**
     * pv支付率
     */
    private Double payPvRateCount;

    /**
     * uv支付率
     */
    private Double payUvRateCount;

    /**
     * 微信支付订单数
     */
    private Integer wxOrderCount;

    /**
     * 支付宝支付订单数
     */
    private Integer alipayOrderCount;

    /**
     * pv订单率
     */
    private Double orderPvRateCount;

    /**
     * uv订单率
     */
    private Double orderUvRateCount;

    public Double getOrderPvRateCount() {
        return orderPvRateCount;
    }

    public void setOrderPvRateCount(Double orderPvRateCount) {
        this.orderPvRateCount = orderPvRateCount;
    }

    public Double getOrderUvRateCount() {
        return orderUvRateCount;
    }

    public void setOrderUvRateCount(Double orderUvRateCount) {
        this.orderUvRateCount = orderUvRateCount;
    }

    public Double getOrderPvCountCount() {
        return orderPvCountCount;
    }

    public void setOrderPvCountCount(Double orderPvCountCount) {
        this.orderPvCountCount = orderPvCountCount;
    }

    public Double getOrderUvCountCount() {
        return orderUvCountCount;
    }

    public void setOrderUvCountCount(Double orderUvCountCount) {
        this.orderUvCountCount = orderUvCountCount;
    }

    public Double getPayPvRateCount() {
        return payPvRateCount;
    }

    public void setPayPvRateCount(Double payPvRateCount) {
        this.payPvRateCount = payPvRateCount;
    }

    public Double getPayUvRateCount() {
        return payUvRateCount;
    }

    public void setPayUvRateCount(Double payUvRateCount) {
        this.payUvRateCount = payUvRateCount;
    }

    public Integer getWxOrderCount() {
        return wxOrderCount;
    }

    public void setWxOrderCount(Integer wxOrderCount) {
        this.wxOrderCount = wxOrderCount;
    }

    public Integer getAlipayOrderCount() {
        return alipayOrderCount;
    }

    public void setAlipayOrderCount(Integer alipayOrderCount) {
        this.alipayOrderCount = alipayOrderCount;
    }

    public Integer getActiveCount() {
        return activeCount;
    }

    public void setActiveCount(Integer activeCount) {
        this.activeCount = activeCount;
    }

    public Integer getActivationCount() {
        return activationCount;
    }

    public void setActivationCount(Integer activationCount) {
        this.activationCount = activationCount;
    }

    public Integer getRegisterCount() {
        return registerCount;
    }

    public void setRegisterCount(Integer registerCount) {
        this.registerCount = registerCount;
    }

    public Double getRegRateCount() {
        return regRateCount;
    }

    public void setRegRateCount(Double regRateCount) {
        this.regRateCount = regRateCount;
    }

    public Integer getEnablementCount() {
        return enablementCount;
    }

    public void setEnablementCount(Integer enablementCount) {
        this.enablementCount = enablementCount;
    }

    public Double getRegActRateCount() {
        return regActRateCount;
    }

    public void setRegActRateCount(Double regActRateCount) {
        this.regActRateCount = regActRateCount;
    }

    public Double getPriceCount() {
        return priceCount;
    }

    public void setPriceCount(Double priceCount) {
        this.priceCount = priceCount;
    }

    public Integer getPvCount() {
        return pvCount;
    }

    public void setPvCount(Integer pvCount) {
        this.pvCount = pvCount;
    }

    public Integer getProductIdCount() {
        return productIdCount;
    }

    public void setProductIdCount(Integer productIdCount) {
        this.productIdCount = productIdCount;
    }

    public Double getCostPriceCount() {
        return costPriceCount;
    }

    public void setCostPriceCount(Double costPriceCount) {
        this.costPriceCount = costPriceCount;
    }

    public Integer getUnpayCountCount() {
        return unpayCountCount;
    }

    public void setUnpayCountCount(Integer unpayCountCount) {
        this.unpayCountCount = unpayCountCount;
    }

    public Integer getFlagCount() {
        return flagCount;
    }

    public void setFlagCount(Integer flagCount) {
        this.flagCount = flagCount;
    }

    public Integer getUvCount() {
        return uvCount;
    }

    public void setUvCount(Integer uvCount) {
        this.uvCount = uvCount;
    }

    public Integer getNewUserCount() {
        return newUserCount;
    }

    public void setNewUserCount(Integer newUserCount) {
        this.newUserCount = newUserCount;
    }

    public Integer getActivationUserCount() {
        return activationUserCount;
    }

    public void setActivationUserCount(Integer activationUserCount) {
        this.activationUserCount = activationUserCount;
    }

    public Integer getNewUserOrderCount() {
        return newUserOrderCount;
    }

    public void setNewUserOrderCount(Integer newUserOrderCount) {
        this.newUserOrderCount = newUserOrderCount;
    }

    public Integer getIntentionOrderCount() {
        return intentionOrderCount;
    }

    public void setIntentionOrderCount(Integer intentionOrderCount) {
        this.intentionOrderCount = intentionOrderCount;
    }

    public Integer getOrderCountCount() {
        return orderCountCount;
    }

    public void setOrderCountCount(Integer orderCountCount) {
        this.orderCountCount = orderCountCount;
    }

    public Integer getPayCountCount() {
        return payCountCount;
    }

    public void setPayCountCount(Integer payCountCount) {
        this.payCountCount = payCountCount;
    }

    public Double getOrderRateCount() {
        return orderRateCount;
    }

    public void setOrderRateCount(Double orderRateCount) {
        this.orderRateCount = orderRateCount;
    }

    public Double getPayRateCount() {
        return payRateCount;
    }

    public void setPayRateCount(Double payRateCount) {
        this.payRateCount = payRateCount;
    }

    public Double getPaymentCount() {
        return paymentCount;
    }

    public void setPaymentCount(Double paymentCount) {
        this.paymentCount = paymentCount;
    }

    public Double getCostCount() {
        return costCount;
    }

    public void setCostCount(Double costCount) {
        this.costCount = costCount;
    }

    public Double getProfitCount() {
        return profitCount;
    }

    public void setProfitCount(Double profitCount) {
        this.profitCount = profitCount;
    }

    public Double getAvgOrderCount() {
        return avgOrderCount;
    }

    public void setAvgOrderCount(Double avgOrderCount) {
        this.avgOrderCount = avgOrderCount;
    }

    /**
     * 客单价：平均订单金额
     */
    private Double avgOrderCount;

    /**
     * 分享用户数
     */
    private Integer sharedUserCount;

    /**
     * 通过分享链接注册的新用户
     */
    private Integer sharedNewUserCount;

    /**
     * 0元测评和dynamicid不为空的支付订单
     */
    private Integer totalOrderCount;

    /**
     * 活跃用户数
     */
    private Integer activeUserCount;

    /**
     * 新增用户当天总浏览时长
     */
    private Double newuserBrowsetimeCount;

    /**
     * 新增用户平均浏览时长 newuser_browsetime/new_user
     */
    private Double newuserAvgtimeCount;

    /**
     * 0元试用页面浏览数
     */
    private Integer zeroViewCount;

    /**
     * 0元试用下单数
     */
    private Integer zeroOrderCount;

    /**
     * 0元测评提交测评总数
     */
    private Integer zeroEvaCount;

    /**
     * 测评提交总数
     */
    private Integer submitedEvaCount;

    /**
     * 第一次提交测评
     */
    private Integer firstEvaCount;

    /**
     * 测评通过数
     */
    private Integer passedEvaCount;

    /**
     * 内容互动人数
     */
    private Integer interactUserCount;

    /**
     * 内容互动量
     */
    private Integer interactCountCount;

    /**
     * 内容分享量
     */
    private Integer contentSharedCount;

    /**
     * 测评内容下单数
     */
    private Integer evaOrderCount;

    /**
     * 当天浏览详情页的时长
     */
    private Double contentBrowsetimeCount;

    /**
     * 有浏览内容详情页的人数
     */
    private Integer contentviewUserCount;

    /**
     * 内容平均浏览时长 content_browsetime/interact_user
     */
    private Double contentAvgtimeCount;

    /**
     * 浏览内容数
     */
    private Integer viewCountCount;

    /**
     * 内容平均浏览个数 view_count/interact_user
     */
    private Double contentAvgcountCount;

    public Integer getSharedUserCount() {
        return sharedUserCount;
    }

    public void setSharedUserCount(Integer sharedUserCount) {
        this.sharedUserCount = sharedUserCount;
    }

    public Integer getSharedNewUserCount() {
        return sharedNewUserCount;
    }

    public void setSharedNewUserCount(Integer sharedNewUserCount) {
        this.sharedNewUserCount = sharedNewUserCount;
    }

    public Integer getTotalOrderCount() {
        return totalOrderCount;
    }

    public void setTotalOrderCount(Integer totalOrderCount) {
        this.totalOrderCount = totalOrderCount;
    }

    public Integer getActiveUserCount() {
        return activeUserCount;
    }

    public void setActiveUserCount(Integer activeUserCount) {
        this.activeUserCount = activeUserCount;
    }

    public Double getNewuserBrowsetimeCount() {
        return newuserBrowsetimeCount;
    }

    public void setNewuserBrowsetimeCount(Double newuserBrowsetimeCount) {
        this.newuserBrowsetimeCount = newuserBrowsetimeCount;
    }

    public Double getNewuserAvgtimeCount() {
        return newuserAvgtimeCount;
    }

    public void setNewuserAvgtimeCount(Double newuserAvgtimeCount) {
        this.newuserAvgtimeCount = newuserAvgtimeCount;
    }

    public Integer getZeroViewCount() {
        return zeroViewCount;
    }

    public void setZeroViewCount(Integer zeroViewCount) {
        this.zeroViewCount = zeroViewCount;
    }

    public Integer getZeroOrderCount() {
        return zeroOrderCount;
    }

    public void setZeroOrderCount(Integer zeroOrderCount) {
        this.zeroOrderCount = zeroOrderCount;
    }

    public Integer getZeroEvaCount() {
        return zeroEvaCount;
    }

    public void setZeroEvaCount(Integer zeroEvaCount) {
        this.zeroEvaCount = zeroEvaCount;
    }

    public Integer getSubmitedEvaCount() {
        return submitedEvaCount;
    }

    public void setSubmitedEvaCount(Integer submitedEvaCount) {
        this.submitedEvaCount = submitedEvaCount;
    }

    public Integer getFirstEvaCount() {
        return firstEvaCount;
    }

    public void setFirstEvaCount(Integer firstEvaCount) {
        this.firstEvaCount = firstEvaCount;
    }

    public Integer getPassedEvaCount() {
        return passedEvaCount;
    }

    public void setPassedEvaCount(Integer passedEvaCount) {
        this.passedEvaCount = passedEvaCount;
    }

    public Integer getInteractUserCount() {
        return interactUserCount;
    }

    public void setInteractUserCount(Integer interactUserCount) {
        this.interactUserCount = interactUserCount;
    }

    public Integer getInteractCountCount() {
        return interactCountCount;
    }

    public void setInteractCountCount(Integer interactCountCount) {
        this.interactCountCount = interactCountCount;
    }

    public Integer getContentSharedCount() {
        return contentSharedCount;
    }

    public void setContentSharedCount(Integer contentSharedCount) {
        this.contentSharedCount = contentSharedCount;
    }

    public Integer getEvaOrderCount() {
        return evaOrderCount;
    }

    public void setEvaOrderCount(Integer evaOrderCount) {
        this.evaOrderCount = evaOrderCount;
    }

    public Double getContentBrowsetimeCount() {
        return contentBrowsetimeCount;
    }

    public void setContentBrowsetimeCount(Double contentBrowsetimeCount) {
        this.contentBrowsetimeCount = contentBrowsetimeCount;
    }

    public Double getContentAvgtimeCount() {
        return contentAvgtimeCount;
    }

    public void setContentAvgtimeCount(Double contentAvgtimeCount) {
        this.contentAvgtimeCount = contentAvgtimeCount;
    }

    public Integer getViewCountCount() {
        return viewCountCount;
    }

    public void setViewCountCount(Integer viewCountCount) {
        this.viewCountCount = viewCountCount;
    }

    public Double getContentAvgcountCount() {
        return contentAvgcountCount;
    }

    public void setContentAvgcountCount(Double contentAvgcountCount) {
        this.contentAvgcountCount = contentAvgcountCount;
    }

    public Integer getContentviewUserCount() {
        return contentviewUserCount;
    }

    public void setContentviewUserCount(Integer contentviewUserCount) {
        this.contentviewUserCount = contentviewUserCount;
    }
}
